home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Technology Seed / ADC Seed CD - July 1999.toast / USB / Mac OS USB DDK v1.2 / Examples / USBSampleStorageDriver / SampleStorageDriverAPI.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-04-15  |  1.6 KB  |  78 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        SampleStorageDriverAPI.c
  3.  
  4.     Contains:    Sample Storage Class functions used by the Storage Class UT Driver
  5.  
  6.     Version:    1.1
  7.  
  8.     Copyright:    © 1998-1999 by Apple Computer, Inc., all rights reserved.
  9.  
  10. */
  11.  
  12.  
  13.  
  14. #include <Errors.h>
  15. #include "SampleStorageDriverAPI.h"
  16.  
  17. // Prototypes for the functions in the dispatch table for the Unit Table Driver
  18. EXTERN_API_C( OSStatus )
  19. StorageInitialize            (void);
  20.  
  21. EXTERN_API_C( OSStatus )
  22. StorageControl                (UInt32 theControlSelector, void *theControlData);
  23.  
  24. EXTERN_API_C( OSStatus )
  25. StorageStatus                (UInt32 theInfoSelector, void *theInfo);
  26.  
  27. EXTERN_API_C( OSStatus )
  28. StorageExecuteCommand        (StorageExecuteCommandPBPtr storageExecuteCommandPBPtr );
  29.  
  30.  
  31. OSStatus StorageInitialize(void)
  32. {
  33. OSStatus    status;
  34.  
  35.     status = StorageClassDriverInitialize();
  36.     
  37.     return status;
  38. }
  39.  
  40. OSStatus StorageControl(UInt32 theControlSelector, void * theControlData)
  41. {
  42. OSStatus    status;
  43.  
  44.     status = StorageClassDriverControl(theControlSelector, theControlData);
  45.  
  46.     return status;
  47. }
  48.  
  49. OSStatus StorageStatus(UInt32 theInfoSelector, void *theInfo)
  50. {
  51. #pragma unused (theInfoSelector, theInfo)
  52. OSStatus    status;
  53.  
  54.     status = StorageClassDriverStatus(theInfoSelector, theInfo);
  55.  
  56.     return status;
  57. }
  58.  
  59. OSStatus StorageExecuteCommand(StorageExecuteCommandPBPtr storageExecuteCommandPBPtr)
  60. {
  61. OSStatus    status;
  62.  
  63.     status = StorageClassDriverExecuteCommand(storageExecuteCommandPBPtr);
  64.     
  65.     return status;
  66. }
  67.  
  68.  
  69.  
  70. StorageClassDispatchTable TheStorageClassDispatchTable =
  71. {
  72.     (UInt32)                        kDispatchTableVersion,
  73.     (StorageInitializeProcPtr)        StorageInitialize,
  74.     (StorageControlProcPtr)            StorageControl,
  75.     (StorageStatusProcPtr)            StorageStatus,
  76.     (StorageExecuteCommandProcPtr)    StorageExecuteCommand
  77. };
  78.